﻿using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Simple.Admin.Application.Commands;
using Simple.Admin.Domain.Models;
using Simple.Common.Application.Commands;
using Simple.Common.EntityFrameworkCore.Repository;

namespace Simple.Admin.Application.CommandHandlers.AdminUserCommand
{
    public class AdminUserCommandHandler 
        //: CommandHandler
    :IRequestHandler<CreateAdminUserCommand, bool>
    {
        private readonly IRepository<AdminUser> _adminUserRepository;
        public AdminUserCommandHandler(IRepository<AdminUser> adminUserRepository)
        {
            _adminUserRepository = adminUserRepository;
        }
        /// <summary>
        /// 创建客户
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task<bool> Handle(CreateAdminUserCommand request, CancellationToken cancellationToken)
        {
            var test = await _adminUserRepository.GetFirstOrDefaultAsync();
            return true;
        }
    }
}